package io.scnb;

import io.scnb.remoting.dto.RpcRequest;
import io.scnb.remoting.dto.RpcResponse;
import io.scnb.remoting.transport.netty.client.NettyClient;

public class NettyClientMain {
    public static void main(String[] args) {
        RpcRequest rpcRequest = RpcRequest.builder()
                .interfaceName("interface")
                .methodName("hello")
                .build();

        NettyClient nettyClient = new NettyClient("127.0.0.1", 8889);
        for (int i = 0; i < 3; i++) {
            nettyClient.sendMessage(rpcRequest);
        }
        RpcResponse rpcResponse = nettyClient.sendMessage(rpcRequest);
        System.out.println(rpcResponse.toString());
    }
}
